# Function to choose a color palette

specify_color_palette <- function(out, n_attributes){
  
  g <- ggplot(out, aes(y = Estimate, x = order, colour = Attribute)) + theme_few()
  c <- ggplot_build(g)$data[[1]]["colour"] %>% distinct(colour) 
  
  default_colour_palette <- c$colour
  default_colour_palette <- c(default_colour_palette[1:n_attributes], "lightgrey", "black")
  
  return(default_colour_palette)
  
}

